from flask import Flask
from gevent import pywsgi
from website.util.read_config import config
from website.api.demo_api import demo_api

# __name__ 代表当前的 python 文件，即把当前的 python 文件当做一个服务启动
app = Flask(__name__)
app.register_blueprint(demo_api, url_prefix='/demo')


if __name__ == '__main__':
    server = pywsgi.WSGIServer((config['config']['ip'], config['config']['port']), app)
    server.serve_forever()
